<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="br.com.lojaweb.modelo.Veiculo"%>
<%@page import="java.util.List"%>
<%@page import="br.com.lojaweb.dao.VeiculoDAO"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link  href="/loja/css/stylesheet.css" rel="stylesheet" type="text/css" >
        <title>....::::::: LOJA :::::::....</title>
    </head>
<body>
  <%@include file="/jspf/header.jspf" %>
  <%@include file="/jspf/menu.jspf" %>
  <div id="conteudo">
  <table class="comBordaSimples">
       <tr>
         <td colspan="5" align="center"><h2>Listagem de Veículos</h2></td>
       </tr>
      
       <td width="300">Descrição</td>
       <td width="150">Modelo</td>
       <td width="60">Preço</td>
       <td width="30"/>
       <td width="30"/>
                    <%
                      VeiculoDAO dao = new VeiculoDAO();
                      List<Veiculo> veiculos = dao.listar();
                      for (Veiculo veiculo : veiculos){
                    %>
                    <tr>
                        <td><%= veiculo.getDescricao() %></td>
                        <td><%= veiculo.getMarca() %></td>
                        <td><%= veiculo.getPreco() %></td>
                        <td><a href=<%= "/loja/veiculo/alterar.jsp?id=" + veiculo.getId()%> > <img alt="" src="../img/edit.png"/></a></td>
                        <td><a href=<%= "/loja/veiculo/excluirVeiculo?id=" + veiculo.getId()%> > <img alt="" src="../img/delete.png"/></a></td>
                    </tr>                    
                    <%
                      }
                    %>
       <tr>
         <td colspan="5" align="center"><a href="/loja/veiculo/novo.jsp">Novo</a></td>
       </tr>
    </table>
    </div>
    <%@include file="/jspf/footer.jspf" %>
</body>
</html>
